Skip to content

Add interactive nudge status updates#65

Merged
WZ merged 8 commits intomainfrom
codex/fix-ticket-prefix-dedupe
Mar 2, 2026
Merged

Add interactive nudge status updates#65
WZ merged 8 commits intomainfrom
codex/fix-ticket-prefix-dedupe

Conversation

@WZ
Copy link
Owner

@WZ WZ commented Mar 1, 2026

Summary

  • add paginated interactive nudge DMs with quick status actions and in-place refresh
  • wire scheduled and /check nudges through the new renderer and status update path
  • harden LLM section-response parsing so malformed confidence values no longer abort report generation

LLM confidence parsing fix

  • repair malformed confidence literals before JSON parse
  • accept cases like 0. Nine / 0. nine as 0.9
  • fall back to 0 for unrecoverable confidence values instead of failing the whole batch
  • tighten the classification prompt to require digit-only confidence values
  • add regression coverage in internal/integrations/llm/llm_test.go

Testing

  • GOCACHE=/tmp/reportbot-go-cache go test ./internal/integrations/llm ./internal/nudge ./internal/storage/sqlite
  • GOCACHE=/tmp/reportbot-go-cache go test ./internal/integrations/slack -run 'TestHandleBlockActions_Nudge'

Notes

  • full go test ./... remains blocked in this environment by existing tests that use httptest listeners

Copilot AI review requested due to automatic review settings March 1, 2026 21:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds interactive nudge status updates to the report bot, giving users the ability to mark work items as done or change their status directly from Slack DMs. It also hardens the LLM JSON response parsing by repairing malformed confidence values.

Changes:

  • Interactive nudge rendering: RenderNudgeForUser now fetches per-user active work items, deduplicates them, paginates them, and renders Slack Blocks with "Mark as Done" and overflow status-change buttons — replacing the previous generic text-only message.
  • Slack block-action handlers: New handlers for nudge_done, nudge_more, nudge_page_prev/next actions, including authorization (the acting user must be the nudge recipient) and ownership checks before mutating work-item status and refreshing the in-place message.
  • LLM confidence repair: parseSectionClassifiedResponse now attempts to repair malformed LLM output (e.g., 0. Nine or nope as confidence values) before failing, with prompt instruction hardening and regression tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/storage/sqlite/db.go New UpdateWorkItemStatus function for status-only updates
internal/storage/sqlite/db_test.go Test coverage for the new function
internal/nudge/nudge.go Core rendering, pagination, deduplication, and name-matching logic for interactive nudges
internal/nudge/deps.go Adds WorkItem type alias and GetItemsByDateRange wrapper for the nudge package
internal/nudge/nudge_render_test.go Tests for RenderNudgeForUser covering generic, paginated, and updated-no-items paths
internal/integrations/slack/slack.go Block-action dispatch and handler functions for done/more/page nudge interactions
internal/integrations/slack/deps.go Action-ID constants, UpdateWorkItemStatus, RenderNudgeForUser, and updated sendNudges wrappers
internal/integrations/slack/nudge_interaction_test.go Integration tests for all four nudge block-action flows
internal/integrations/llm/llm.go repairSectionClassifiedResponse and helpers to normalize malformed confidence literals
internal/integrations/llm/llm_test.go Regression tests for the confidence repair and normalizeConfidenceLiteral
internal/app/app.go Passes db to the updated StartNudgeScheduler signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@WZ WZ merged commit 874b370 into main Mar 2, 2026
1 check passed
@WZ WZ deleted the codex/fix-ticket-prefix-dedupe branch March 2, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants